package org.jackysoft.service.impl;

import javax.annotation.Resource;

import org.jackysoft.data.AbstractDataProvider;
import org.jackysoft.entity.OsVariable;
import org.jackysoft.mapper.OsVariableMapper;
import org.jackysoft.service.OsVariableService;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

@Service
public class OsVariableServiceImpl extends AbstractDataProvider<OsVariable>
		implements OsVariableService {

	
	@Resource
	OsVariableMapper mapper;
	
	public OsVariableServiceImpl() {
		super();
	}

	@Override
	public OsVariable findOneByName(long refid, String name) throws DataAccessException {
		
	    OsVariable bean   = mapper.findByName(refid, name);
		return bean;		
	}
		

	@Override
	public void setVariable(long refid, String name, String value)
			throws DataAccessException {
		mapper.setValue(refid, name, value);
	}

	@Override
	public String getValue(long refid, String name) {
		String value = mapper.findValue(refid, name);
		return value;
	}

}
